<?php

use yii\db\Migration;

/**
 * Handles the creation of table `material`.
 */
class m170328_024645_create_material_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('{{%material}}', [
            'id' => $this->primaryKey()->comment('附件序号'),
	        'type'=>$this->smallInteger()->defaultValue(0)->comment('类型,0:文字,1:图片,2:图文,3:视频'),
	        'description'=>$this->text()->comment('描述'),
	        'filename'=>$this->string()->comment('文件名'),
	        'is_deleted'=>$this->smallInteger()->defaultValue(0)->comment('是否已删除,0:没有删除,1:删除')
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('{{%material}}');
    }
}
